<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.4.2">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"wrr123.github.io","root":"/","scheme":"Muse","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.json"};
  </script>

  <meta name="description" content="树红黑树它（Red Black Tree）是一种自平衡二叉查找树，是在计算机科学中用到的一种数据结构，典型的用途是实现关联数组，是平衡二叉树和AVL树的折中。 红黑树与AVL树的比较： AVL树的时间复杂度虽然优于红黑树，但是对于现在的计算机，cpu太快，可以忽略性能差异； 红黑树的插入删除比AVL树更便于控制操作； 红黑树的整体性能略优于AVL树（红黑树旋转情况少于AVL树）">
<meta property="og:type" content="article">
<meta property="og:title" content="软考-数据结构3">
<meta property="og:url" content="https://wrr123.github.io/2021/02/23/%E8%BD%AF%E8%80%83-%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%843/index.html">
<meta property="og:site_name" content="一缕烟气">
<meta property="og:description" content="树红黑树它（Red Black Tree）是一种自平衡二叉查找树，是在计算机科学中用到的一种数据结构，典型的用途是实现关联数组，是平衡二叉树和AVL树的折中。 红黑树与AVL树的比较： AVL树的时间复杂度虽然优于红黑树，但是对于现在的计算机，cpu太快，可以忽略性能差异； 红黑树的插入删除比AVL树更便于控制操作； 红黑树的整体性能略优于AVL树（红黑树旋转情况少于AVL树）">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2021-02-23T01:22:33.000Z">
<meta property="article:modified_time" content="2022-02-18T02:52:04.554Z">
<meta property="article:author" content="田园隐士">
<meta property="article:tag" content="软考">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="https://wrr123.github.io/2021/02/23/%E8%BD%AF%E8%80%83-%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%843/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>软考-数据结构3 | 一缕烟气</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

<link rel="alternate" href="/atom.xml" title="一缕烟气" type="application/atom+xml">
</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">一缕烟气</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">沧海月明珠有泪，蓝田日暖玉生烟</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://wrr123.github.io/2021/02/23/%E8%BD%AF%E8%80%83-%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%843/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="田园隐士">
      <meta itemprop="description" content="talk is cheap, show me the code">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="一缕烟气">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          软考-数据结构3
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2021-02-23 09:22:33" itemprop="dateCreated datePublished" datetime="2021-02-23T09:22:33+08:00">2021-02-23</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2022-02-18 10:52:04" itemprop="dateModified" datetime="2022-02-18T10:52:04+08:00">2022-02-18</time>
              </span>

          
            <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv" style="display: none;">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span id="busuanzi_value_page_pv"></span>
            </span><br>
            <span class="post-meta-item" title="本文字数">
              <span class="post-meta-item-icon">
                <i class="far fa-file-word"></i>
              </span>
                <span class="post-meta-item-text">本文字数：</span>
              <span>2.6k</span>
            </span>
            <span class="post-meta-item" title="阅读时长">
              <span class="post-meta-item-icon">
                <i class="far fa-clock"></i>
              </span>
                <span class="post-meta-item-text">阅读时长 &asymp;</span>
              <span>2 分钟</span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h4 id="树"><a href="#树" class="headerlink" title="树"></a>树</h4><h5 id="红黑树"><a href="#红黑树" class="headerlink" title="红黑树"></a>红黑树</h5><p>它（<code>Red Black Tree</code>）是一种自平衡二叉查找树，是在计算机科学中用到的一种数据结构，典型的用途是实现关联数组，是平衡二叉树和<code>AVL</code>树的折中。</p>
<h6 id="红黑树与AVL树的比较："><a href="#红黑树与AVL树的比较：" class="headerlink" title="红黑树与AVL树的比较："></a>红黑树与AVL树的比较：</h6><ol>
<li>AVL树的时间复杂度虽然优于红黑树，但是对于现在的计算机，cpu太快，可以忽略性能差异；</li>
<li>红黑树的插入删除比AVL树更便于控制操作；</li>
<li>红黑树的整体性能略优于AVL树（红黑树旋转情况少于AVL树）</li>
</ol>
<span id="more"></span>
<h6 id="具体的性质："><a href="#具体的性质：" class="headerlink" title="具体的性质："></a>具体的性质：</h6><ul>
<li>每个节点的颜色不是黑色，就是红色；</li>
<li>根节点是黑色的；</li>
<li>如果一个节点是红色，那么它的两个子节点就是黑色的（没有连续的红节点）；</li>
<li>对于每个节点，从该节点到其后代叶子节点的简单路径上，均包含相同数目的黑色节点。</li>
</ul>
<h5 id="哈夫曼树"><a href="#哈夫曼树" class="headerlink" title="哈夫曼树"></a>哈夫曼树</h5><p>它又称最优二叉树，是一种带权路径长度最短的二叉树。</p>
<h6 id="几个名词的解释："><a href="#几个名词的解释：" class="headerlink" title="几个名词的解释："></a>几个名词的解释：</h6><ul>
<li><code>路径与路径长度</code>：从树中一个节点到另一个节点之间的分支构成了两个节点之间的路径，路径上的分支数目称作路径长度。若规定根节点位于第一层，则根节点到第<code>H</code>层的节点的路径长度为<code>H - 1</code>。</li>
<li><code>节点的权</code> ：将树中的节点赋予一个某种含义的数值作为该节点的权值，该值称为节点的权；</li>
<li><code>带权路径长度</code>：从根节点到某个节点之间的路径长度与该节点的权的乘积。</li>
<li><code>树的带权路径长度</code>：树的带权路径长度为所有叶子节点的带权路径长度之和，称为 <code>WPL</code>。</li>
</ul>
<h6 id="哈夫曼树的构建"><a href="#哈夫曼树的构建" class="headerlink" title="哈夫曼树的构建"></a>哈夫曼树的构建</h6><p>假设有 <code>n</code> 个权值，则构造出的哈夫曼树有 <code>n</code> 个叶子节点。<code>n</code> 个权值分别为 <code>w1, w2, w3, ..., wn</code>，哈夫曼树的构造规则如下：</p>
<ul>
<li>将<code>w1, w2, ..., wn</code> 看成是有 <code>n</code> 棵树的森林（每棵树仅有一个节点）</li>
<li>在森林中选出根节点的权值最小的两棵树进行合并，作为一棵新树的左、右子树，且新树的根节点权值为其左、右子树根节点权值之和；</li>
<li>从森林中删除选取的两棵树，并将新树加入森林；</li>
<li>重复上面两步，直到森林只剩一棵树为止，该树即为所求得的哈夫曼树。</li>
</ul>
<h6 id="哈夫曼编码"><a href="#哈夫曼编码" class="headerlink" title="哈夫曼编码"></a>哈夫曼编码</h6><p>从根节点到每一个叶子节点的路径上，左分支记为 <code>0</code>，右分支记为 <code>1</code>，将这些 <code>0</code> 和 <code>1</code> 连起来即为叶子节点的哈夫曼编码。</p>
<h5 id="前缀树（Trie-Tree）"><a href="#前缀树（Trie-Tree）" class="headerlink" title="前缀树（Trie Tree）"></a>前缀树（Trie Tree）</h5><p>它又称为字典树、单词查找树或键树，是一种树形结构，是一种哈希表的变种。典型应用是用于统计，排序和保存大量的字符串（但不仅限于字符串），所以经常被搜索引擎系统用于文本词频统计。</p>
<p>它的优点是：利用字符串的公共前缀来减少查找时间，最大限度地减少无谓地字符串比较，查询效率比哈希树高。</p>
<h6 id="基本性质："><a href="#基本性质：" class="headerlink" title="基本性质："></a>基本性质：</h6><ul>
<li>根节点不包含字符，除根节点之外的每一个子节点都包含一个字符；</li>
<li>从根节点到某一个节点，路径上所经过的字符连接起来，为该节点对应的字符串；</li>
<li>每个节点的所有子节点包含的字符互不相同；</li>
<li>从第一个字符开始有连续重复的字符只占用一个节点，比如单词<code>to, ten</code>中重复的字符 <code>t</code> 只占用一个节点。</li>
</ul>
<h4 id="图"><a href="#图" class="headerlink" title="图"></a>图</h4><p>图（graph）是由顶点和连接顶点的边构成的离散结构。在计算机科学中，图是最灵活的数据结构之一，很多问题都可以通过图模型进行建模求解。例如：</p>
<ul>
<li>生态环境中不同物种的互相竞争</li>
<li>人与人之间的社交与关系网络</li>
<li>化学上用图区分结构不同但分子式相同的同分异构体</li>
<li>分析计算机网络的拓扑结构确定两台计算机是否可以通信</li>
<li>找到两个城市之间的最短路径等等。</li>
</ul>
<h5 id="基础"><a href="#基础" class="headerlink" title="基础"></a>基础</h5><h6 id="定义"><a href="#定义" class="headerlink" title="定义"></a>定义</h6><p>图是由顶点的有穷非空集合和顶点之间边的集合组成，通常表示为:<code>G(V, E)</code>，其中 <code>G</code> 表示一个图，<code>V</code>是图<code>G</code>中顶点的集合，<code>E</code>是图<code>G</code>中边的集合。</p>
<p>与线性表、树的差异：</p>
<ul>
<li>线性表中我们把数据元素叫做元素，树中将数据元素叫做节(结)点，在图中数据元素，我们称之为顶点（<code>Vertex</code>）；</li>
<li>线性表可以没有元素，称为空表；树中可以没有节点，称为空树；<span style="color:red;">但是，在图中不允许没有顶点（有穷非空性）</span>；</li>
<li>线性表中的各元素是线性关系，树中的各节点是层次关系，而图中各顶点的关系是用边来表示（边集可以为空）</li>
</ul>
<h6 id="相关的术语"><a href="#相关的术语" class="headerlink" title="相关的术语"></a>相关的术语</h6><ul>
<li><code>顶点的度</code>：顶点<code>Vi</code>的度（<code>Degree</code>）是指在图中与<code>Vi</code>相关联的边的条数。对于有向图来说，有入度（In-Degree）和出度(Out-Degree)之分，有向图顶点的度等于该顶点的入度和出度之和。</li>
<li><code>邻接</code>：若无向图中的两个顶点<code>V1</code>和<code>V2</code>存在一条边<code>(V1, V2)</code>，则称顶点 <code>V1</code> 和 <code>V2</code> 邻接(Adjacent)。若有向图中存在一条边<code>&lt;V3, V2&gt;</code>，则称顶点 <code>V3</code>与顶点<code>V2</code>邻接，且是<code>V3</code>邻接到<code>V2</code>或<code>V2</code>邻接至<code>V3</code>。</li>
<li><code>路径</code>：在无向图中，若从顶点<code>Vi</code>出发有一组边可到达顶点 <code>Vj</code>，则称顶点<code>Vi</code>到顶点<code>Vj</code>的顶点序列为从顶点<code>Vi</code>到顶点<code>Vj</code>的路径（Path）。</li>
<li><code>连通</code>：若从 <code>Vi</code>到<code>Vj</code>有路径可通，则称顶点 <code>Vi</code>和顶点<code>Vj</code>是连通(Connected)的。</li>
<li><code>权(Weight)</code>：有些图的边会弧具有与它相关的数字，这种与图的边或弧相关的数叫做权(weight)。</li>
</ul>
<h6 id="类型"><a href="#类型" class="headerlink" title="类型"></a>类型</h6><ul>
<li><p>无向图</p>
<p>如果图中任意两个顶点之间的边都是无向边（简而言之就是没有方向的边），则称该图为无向图（Undirected graphs）.</p>
<p>无向图中的边使用小括号<code>()</code>表示,比如 <code>(V1, V2)</code>。</p>
</li>
<li><p>有向图</p>
<p>如果图中任意两个顶点之间的边是有向边（简而言之就是有方向的边），则称该图为有向图（Directed graphs）。</p>
<p>有向图中的边使用尖括号<code>&lt;&gt;</code>表示，比如<code>&lt;V1, V2&gt;</code>。</p>
</li>
<li><p>完全图</p>
<p><code>无向完全边</code>：在无向图中，如果任意两个顶点之间都存在边，则称该图为无向完全图（含有<code>n</code>各个顶点的无向完全图有<code>(n x (n - 1)) / 2</code>）条边）。</p>
<p><code>有向完全图</code>：在有向图中，如果任意两个顶点之间都存在方向互为相反的两条弧，则称该图为有向完全图。（含有 <code>n</code> 个顶点的有向完全图有<code>n x (n - 1)</code> 条边）。</p>
</li>
</ul>
<h5 id="遍历"><a href="#遍历" class="headerlink" title="遍历"></a>遍历</h5><h6 id="深度优先搜索（Depth-First-Search）"><a href="#深度优先搜索（Depth-First-Search）" class="headerlink" title="深度优先搜索（Depth First Search）"></a>深度优先搜索（Depth First Search）</h6><p>它的思想：假设初始状态是图中所有顶点均未被访问，则从某个顶点<code>v</code>出发，首先访问该顶点，然后依次从它的各个未被访问的邻接点出发深度优先搜索遍历图，直至图中所有和<code>v</code>有路径相通的顶点都被访问到。若此时尚有其他顶点未被访问到，则另选一个未被访问的顶点作为起始点，重复上述过程，直至图中所有顶点都被访问到为止。</p>
<p>显然，深度优先搜索是一个递归的过程。</p>
<h6 id="广度优先搜索（Breadth-First-Search）"><a href="#广度优先搜索（Breadth-First-Search）" class="headerlink" title="广度优先搜索（Breadth First Search）"></a>广度优先搜索（Breadth First Search）</h6><p>又称为”宽度优先搜索“或”横向优先搜索“。</p>
<p>它的思想是：从图中某顶点<code>v</code>出发，在访问了<code>v</code>之后依次访问<code>v</code>的各个未曾访问过的邻接点，然后从这些邻接点出发依次访问它们的邻接点，并使得”先被访问的顶点的邻接点先于后被访问的顶点的邻接点被访问，直到图中所有已被访问的顶点的邻接点都被访问到“。如果此时图中尚有顶点未被访问，则需要另选一个未被访问的顶点作为新的起始点，重复上述过程，直至图中所有顶点都被访问到为止。</p>

    </div>

    
    
    
        

  <div class="followme">
    <p>欢迎关注我的其它发布渠道</p>

    <div class="social-list">

        <div class="social-item">
          <a target="_blank" class="social-link" href="/atom.xml">
            <span class="icon">
              <i class="fa fa-rss"></i>
            </span>

            <span class="label">RSS</span>
          </a>
        </div>
    </div>
  </div>


      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/%E8%BD%AF%E8%80%83/" rel="tag"># 软考</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2021/02/22/%E8%BD%AF%E8%80%83-%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%842/" rel="prev" title="软考-数据结构2">
      <i class="fa fa-chevron-left"></i> 软考-数据结构2
    </a></div>
      <div class="post-nav-item">
    <a href="/2021/02/24/%E8%BD%AF%E8%80%83-%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%844/" rel="next" title="软考-数据结构4">
      软考-数据结构4 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-4"><a class="nav-link" href="#%E6%A0%91"><span class="nav-number">1.</span> <span class="nav-text">树</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#%E7%BA%A2%E9%BB%91%E6%A0%91"><span class="nav-number">1.1.</span> <span class="nav-text">红黑树</span></a><ol class="nav-child"><li class="nav-item nav-level-6"><a class="nav-link" href="#%E7%BA%A2%E9%BB%91%E6%A0%91%E4%B8%8EAVL%E6%A0%91%E7%9A%84%E6%AF%94%E8%BE%83%EF%BC%9A"><span class="nav-number">1.1.1.</span> <span class="nav-text">红黑树与AVL树的比较：</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#%E5%85%B7%E4%BD%93%E7%9A%84%E6%80%A7%E8%B4%A8%EF%BC%9A"><span class="nav-number">1.1.2.</span> <span class="nav-text">具体的性质：</span></a></li></ol></li><li class="nav-item nav-level-5"><a class="nav-link" href="#%E5%93%88%E5%A4%AB%E6%9B%BC%E6%A0%91"><span class="nav-number">1.2.</span> <span class="nav-text">哈夫曼树</span></a><ol class="nav-child"><li class="nav-item nav-level-6"><a class="nav-link" href="#%E5%87%A0%E4%B8%AA%E5%90%8D%E8%AF%8D%E7%9A%84%E8%A7%A3%E9%87%8A%EF%BC%9A"><span class="nav-number">1.2.1.</span> <span class="nav-text">几个名词的解释：</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#%E5%93%88%E5%A4%AB%E6%9B%BC%E6%A0%91%E7%9A%84%E6%9E%84%E5%BB%BA"><span class="nav-number">1.2.2.</span> <span class="nav-text">哈夫曼树的构建</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#%E5%93%88%E5%A4%AB%E6%9B%BC%E7%BC%96%E7%A0%81"><span class="nav-number">1.2.3.</span> <span class="nav-text">哈夫曼编码</span></a></li></ol></li><li class="nav-item nav-level-5"><a class="nav-link" href="#%E5%89%8D%E7%BC%80%E6%A0%91%EF%BC%88Trie-Tree%EF%BC%89"><span class="nav-number">1.3.</span> <span class="nav-text">前缀树（Trie Tree）</span></a><ol class="nav-child"><li class="nav-item nav-level-6"><a class="nav-link" href="#%E5%9F%BA%E6%9C%AC%E6%80%A7%E8%B4%A8%EF%BC%9A"><span class="nav-number">1.3.1.</span> <span class="nav-text">基本性质：</span></a></li></ol></li></ol></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%9B%BE"><span class="nav-number">2.</span> <span class="nav-text">图</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#%E5%9F%BA%E7%A1%80"><span class="nav-number">2.1.</span> <span class="nav-text">基础</span></a><ol class="nav-child"><li class="nav-item nav-level-6"><a class="nav-link" href="#%E5%AE%9A%E4%B9%89"><span class="nav-number">2.1.1.</span> <span class="nav-text">定义</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#%E7%9B%B8%E5%85%B3%E7%9A%84%E6%9C%AF%E8%AF%AD"><span class="nav-number">2.1.2.</span> <span class="nav-text">相关的术语</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#%E7%B1%BB%E5%9E%8B"><span class="nav-number">2.1.3.</span> <span class="nav-text">类型</span></a></li></ol></li><li class="nav-item nav-level-5"><a class="nav-link" href="#%E9%81%8D%E5%8E%86"><span class="nav-number">2.2.</span> <span class="nav-text">遍历</span></a><ol class="nav-child"><li class="nav-item nav-level-6"><a class="nav-link" href="#%E6%B7%B1%E5%BA%A6%E4%BC%98%E5%85%88%E6%90%9C%E7%B4%A2%EF%BC%88Depth-First-Search%EF%BC%89"><span class="nav-number">2.2.1.</span> <span class="nav-text">深度优先搜索（Depth First Search）</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#%E5%B9%BF%E5%BA%A6%E4%BC%98%E5%85%88%E6%90%9C%E7%B4%A2%EF%BC%88Breadth-First-Search%EF%BC%89"><span class="nav-number">2.2.2.</span> <span class="nav-text">广度优先搜索（Breadth First Search）</span></a></li></ol></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">田园隐士</p>
  <div class="site-description" itemprop="description">talk is cheap, show me the code</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">347</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
        <span class="site-state-item-count">53</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
        <span class="site-state-item-count">115</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2022</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">田园隐士</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-area"></i>
    </span>
    <span title="站点总字数">587k</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
    <span title="站点阅读时长">8:53</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://muse.theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Muse</a> 强力驱动
  </div>

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/muse.js"></script>


<script src="/js/next-boot.js"></script>




  




  
<script src="/js/local-search.js"></script>













  

  

  

</body>
</html>
